package org.example.huawei;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @version 1.0.0
 * @author: lynn
 * @description: 线程池实现
 * @date: 2021/6/4 11:09
 */
public class OrderStartThreadExecutors {
    public static void main(String[] args) {
        Thread t1=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("t1 ..");
            }
        });
        Thread t2=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("t2 ..");
            }
        });
        Thread t3=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("t3 ..");
            }
        });
        ExecutorService executorService= Executors.newSingleThreadExecutor();
        executorService.execute(t1); executorService.execute(t2); executorService.execute(t3);
    }
}
